GetTasks ForUser |
This Web service operation lists the tasks available for the specific user based on the requested parameters.
Resource URI
/v1/cases/getTasksForUser
Request Type
HTTP POST
HTTP Header Parameters
Parameter |
Description |
Accepted Input Values |
---|---|---|
SAMLart |
The SAML artifact received after authentication. | For more information on how to authenticate, see Login. |
otdsticket | The OTDSTicket received after authentication from OTDS. The OTDSTicket must be provided as a header parameter. | For more information on how to authenticate, see Login. |
Note : You must provide either SAMLart or otdsticket header parameter. If you provide both the header parameters, it will internally work based on SAMLart.
Note: The supported output formats are:
- JSON
- XML
Request Parameters
Parameter |
Description |
Accepted Input Values |
---|---|---|
User |
User DN. |
Dn Value. For example: cn=NewLaxman,cn=organizational users,o=system,cn=cordys,cn=defaultinst,o=opentext.net |
Type |
Task type details. |
For example: UI_TASK |
merge | Filters the duplicate task details if it is assigned to more than one role of the specific user. |
String Value, true or false |
Parameter
|
Parameter details for the task based on the name value pairs. |
For example: showOnStartPage:true The name and value is separate with ":". This can be referred as XML structure value. For example, |
Note: All the above parameters must be send inside the GetTasksForUser object in the payload section of the HTTP POST call.
Sample HTTP Payload
POST accepts the payload content only in the XML format as follows:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <GetTasksForUser merge="true" xmlns="http://schemas.cordys.com/task/1.0/runtime/"> <User>cn=lgautam,cn=organizational users,o=system,cn=cordys,cn=OTDS_Cordys1,o=mydomain.com</User> <Type>UI_TASK</Type> <Parameters> <Parameter name="showOnStartPage" value="true"/> </Parameters> </GetTasksForUser>
Sample Client Example
Add the HTTP Payload as follows:
public static void main(String[] args) throws JAXBException,ClientProtocolException, IOException { com.cordys.entity.bean.GetTasksForUser taskForUser = new com.cordys.entity.bean.GetTasksForUser(); com.cordys.entity.bean.GetTasksForUser.Parameters parameters =new com.cordys.entity.bean.GetTasksForUser.Parameters(); com.cordys.entity.bean.GetTasksForUser.Parameters.Parameter param=new com.cordys.entity.bean.GetTasksForUser.Parameters.Parameter(); param.setName("showOnStartPage"); param.setValue("true"); taskForUser.setType("UI_TASK"); taskForUser.setUser("cn=lgautam,cn=organizational users,o=system,cn=cordys,cn=OTDS_Cordys1,o=mydomain.com"); taskForUser.setMerge(true); parameters.setParameter(param); taskForUser.setParameters(parameters); StringWriter writer = new StringWriter(); JAXBContext jaxbContext = JAXBContext.newInstance(com.cordys.entity.bean.GetTasksForUser.class); Marshaller jaxbMarshaller = jaxbContext.createMarshaller(); jaxbMarshaller.marshal(taskForUser, writer); DefaultHttpClient httpClient = new DefaultHttpClient(); // Define a postRequest request HttpPost postRequest = new HttpPost( "http://<HOST>:<PORT>/BPMService/v1/tasks/getTasksForUser"); // Set the API media type in http content-type header //postRequest.addHeader("SAMLart","MDEUkKOCWs8vQY+gYqa28mHjKoN0V+gJI8/N6OtJ4BUvbVXczEZc80Fb"); postRequest.addHeader("otdsticket","ADDCJ4McPnnLg1i0YpoYmOA24-5JmWIIZ"); postRequest.addHeader("content-type", "application/xml"); //postRequest.addHeader("content-type", "application/json"); // Set the request post body StringEntity userEntity = new StringEntity(writer.getBuffer() .toString()); net.sf.json.JSON objJson = XMLSerializer.readObject(writer.getBuffer().toString()); System.out.println("JSON data : " + objJson); StringEntity userEntity1 = new StringEntity(objJson.toString()); postRequest.setEntity(userEntity); // Send the request; It will immediately return the response in // HttpResponse object if any HttpResponse response = httpClient.execute(postRequest); ... }
Note: The com.cordys.entity.bean.GetTasksForUser object structure has been attached below, which is expected as a parameter of the REST API:
public Response transferTask( com.cordys.entity.bean.GetTasksForUser)
GetTasksForUser.java class is packed on BPMServiceClient.jar.
Response Parameters
Parameter |
Description |
---|---|
Description |
Description of the task |
Property |
Task details are provided based on the given parameters. It takes name value pairs. For example, |
Input |
Input data that is required for the task execution |
Output |
Result of the task execution |
LaunchingInfo |
Data that is required for launching an application |
TaskPart |
An activity that is a part of the task |
RelatedTask |
Task that is referred by the parent task |
Sample Response
JSONResponse: { tuple: [2]0: { old: [1]0: { Task: { id: "cordys_notif_MyInboxTask"type: "UI_TASK"name: "My Inbox"dn: nullconfigTaskId: nullDescription: "Receive and respond to Cordys tasks and notifications"Properties: { Property: [1]0: { name: "showOnStartPage"value: "true" }-- }-LaunchingInfo: { any: [1]0: "<?xml version="1.0" encoding="UTF-16"?> <Application display="visible" xmlns="http: //schemas.cordys.com/task/1.0/" xmlns:S="http: //schemas.xmlsoap.org/soap/envelope/" xmlns:ns2="http: //schemas.cordys.com/task/1.0/" xmlns:ns3="http: //schemas.cordys.com/task/1.0/runtime/"><id>cordys_notif_MyInboxTask</id><url>com/cordys/notification/inbox.caf</url><caption>My Inbox</caption><description>My Inbox</description><icon>wcp/theme/default/icon/task/worklistmanagementconsole.png</icon><info>Receive and respond to Cordys tasks and notifications</info><frame height="80%" left="10%" width="80%">main</frame></Application>"- }- }- }-- }-1: { old: [1]0: { Task: { id: "cordys_uddiconn_PersonalExternalAccess"type: "UI_TASK"name: "Personal External Access"dn: nullconfigTaskId: nullDescription: "Personal External Access"Properties: { Property: [1]0: { name: "showOnStartPage"value: "true" }-- }-LaunchingInfo: { any: [1]0: "<?xml version="1.0" encoding="UTF-16"?> <Application display="visible" xmlns="http: //schemas.cordys.com/task/1.0/" xmlns:S="http: //schemas.xmlsoap.org/soap/envelope/" xmlns:ns2="http: //schemas.cordys.com/task/1.0/" xmlns:ns3="http: //schemas.cordys.com/task/1.0/runtime/"><icon>/cordys/wcp/theme/default/icon/authorization/user_authenticated.png</icon><url>/cordys/com/cordys/uddi/PersonalExternalAccess.caf</url><id>cordys_uddiconn_PersonalExternalAccess</id><description>Personal External Access</description><caption>Personal External Access</caption><frame features="center: yes" height="70%" left="10%" top="10%" width="80%">main</frame></Application>"- }- }- }-- }--merge: true }